# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=libsoup
pkgver=2.60.0
pkgrel=1
pkgdesc="HTTP client/server library for GNOME"
url="https://wiki.gnome.org/Projects/libsoup"
arch=(i686 x86_64)
license=(LGPL)
depends=(glib2 libxml2 glib-networking sqlite krb5)
makedepends=(intltool gobject-introspection python vala git gtk-doc)
checkdepends=(apache php-apache)
_commit=a53e94a5b1b4319976daced199e3e51341326201  # tags/2.60.0^0
source=("git+https://git.gnome.org/browse/libsoup#commit=$_commit"
        0001-Configure-PHP-to-load-the-XMLRPC-extension-if-presen.patch)
sha256sums=('SKIP'
            '1ad674810317ff2be817d00e9490d0d70014a38682a3dabc22801ae5db78aecc')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  # https://bugzilla.gnome.org/show_bug.cgi?id=782410
  patch -Np1 -i ../0001-Configure-PHP-to-load-the-XMLRPC-extension-if-presen.patch

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-static --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
